Stop importing Testing from ContainerTestSupport - #2118
Conversation
|
@Hashim1999164 The change looks good but you need signed, verified commits. |
b69daff to
a6cbf01
Compare
a6cbf01 to
39d8398
Compare
|
@Hashim1999164 I think this change is going to require more work as the fixture references Before you do that, what version of swift are you using? We don't see |
|
@jglogan Thanks for the review. On signed commits: Verify commit signatures is already passing on this PR for the latest commit, so I am not rewriting history. On Swift version: locally this is Apple Swift 6.3 (swiftlang-6.3.0.123.5, swift-driver 1.148.6). The failing CI job uses DEVELOPER_DIR=/Applications/Xcode_swift_6.3.app/Contents/Developer. On the Test.current errors: ContainerTestSupport is a regular library target. After dropping import Testing, Test and Test.Case are not in scope, so make all fails while compiling ContainerFixture.swift. The cannot infer contextual base for .regularExpression error is a follow-on from testName not type-checking. I pushed a follow-up that keeps Testing out of ContainerTestSupport. The fixture now takes a TestIdentity value. IntegrationTests has a small wrapper that reads Test.current and Test.Case.current and forwards them, so ContainerFixture.with { ... } still gets unique log and scratch names. |
Fixes #2052
ContainerTestSupport is a library product, so swift build compiles it outside a test target. Importing the Testing module there fails with no such module Testing, which breaks make all.
The assert helpers now throw CommandError.executionFailed with the same messages. Callers already use try, so test failures still surface. Unused Testing imports were removed as well.
Test plan
Confirmed Sources/ContainerTestSupport no longer imports Testing. Built the ContainerTestSupport product successfully with swift build.